# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=jbig2enc
pkgver=0.29
pkgrel=2
pkgdesc="JBIG2 Encoder"
url="https://github.com/agl/jbig2enc"
arch="all"
license="Apache-2.0"
depends="python3"
makedepends="
	leptonica-dev
	zlib-dev
	automake
	autoconf
	libtool
	"
subpackages="$pkgname-doc $pkgname-static $pkgname-dev"
source="jbig2enc-$pkgver.tar.gz::https://github.com/agl/jbig2enc/archive/$pkgver.tar.gz
	10-python3.patch
	20-shebang.patch
	"

build() {
	./autogen.sh
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
aa50cdaf61ef0ae473c8139d8da2a4c374450f8d0d31e2260031e8086dab9201c303c86d50cd51427135bef500718cbc3a53baabf2bf505f8908c22a3d361c51  jbig2enc-0.29.tar.gz
7b0813f6a9aee71925320fb080d78846092f3436328208062dbfc92dafe1c90c931b5d7e28d1915f210666ddb3444405ddcee1290d67112172515fa20e0e14a8  10-python3.patch
d87e9ce391d29385a8df6654935fcc5a9ef4ef320650e4060b233c7503b380aa2ea8b77eb2f8fbd9b85eaf66e198f8aae85cf1396f032995121f7a297fec1496  20-shebang.patch
"
